package com.runmi.webchat.aftersale.web.common.controller;


import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.runmi.webchat.aftersale.common.result.Result;
import com.runmi.webchat.aftersale.web.base.BaseController;
import com.runmi.webchat.aftersale.web.common.service.RegionService;

/**
 * 区域管理接口
 * Created by zhusheng on 2017/11/17 0017.
 */
@RestController
@RequestMapping(value = "/common/region")
public class RegionController extends BaseController {
    @Autowired
    private RegionService regionService;

    @ApiOperation(value = "根据父级id查询子区域列表", notes = "根据父级id查询子区域列表", tags={ "公共", })
    @PostMapping(value = "/queryProvinceRegions", produces = { "application/json" })
    public Result queryProvinceRegions(
            @ApiParam(value = "上一级区域id(查询省时传0)",required = true)@RequestParam(value = "parentRegionId") Integer parentRegionId
            ){
            return regionService.queryRegionsByParentId(parentRegionId);
    }

}
